;**********************************›;›; Copy Program›;›;**********************************›;›;SET $E=$4100››;SET $491=$4100››CARD Start›CARD EndProg›BYTE ARRAY ban1="ÕÎÉÖÅÒÓÁÌ ÓÅÃÔÏÒ ÃÏÐÉÅÒ ±®°",› ban2=" by Jim Patchell",› ban3="Copyright (c) 1987 by EMC"›;›MODULE›INCLUDE "D2:CPRTL.ACT"›PROC bitmap(CARD sec BYTE ARRAY map)›;set bit indicating sector››BYTE index,bit,mask››index = (sec-1)/8›bit = (sec-1)MOD 8›mask = 1 LSH bit›map(index) = map(index) % mask›RETURN››BYTE FUNC check(CARD sec BYTE ARRAY map)››BYTE index,bit,mask››index = (sec-1)/8›bit = (sec-1)MOD 8›mask = 1 LSH bit›bit = map(index) & mask›RETURN(bit)››BYTE FUNC clear(BYTE ARRAY buff CARD l)››CARD i,a››i=0›DO› a = buff(i)› IF a > 0 THEN› RETURN(0)› FI› i ==+1› UNTIL i = l›OD›RETURN(1) ;true if clear ››PROC Zer(BYTE ARRAY a)››BYTE i››i = 0›DO› a(i) = 0;› i ==+1› UNTIL i = 130›OD›RETURN››PROC main()››BYTE ARRAY buff,t_buff,blank›BYTE ARRAY stat=$02EA,sec_stat›BYTE src_drv,res,a,pass›BYTE des_drv,b,done›CARD insec,track,bfr,size,outsec›CARD phree,dum,n_sec,tmp›CARD count,cnt››done = 0›Close(0)›Close(7)›Open(0,"E:",12,0)›Open(7,"K:",4,0)›AllocInit()›print_ban()›DO› Print("Input source drive number:")› src_drv=InputB()› a=ck_drv(src_drv)› UNTIL a=0›OD›DO› Print("Input destination drive:")› des_drv=InputB()› a=ck_drv(des_drv)› UNTIL a=0›OD›buff=Alloc(256)›sec_stat=Alloc(130)›blank=Alloc(130)›Zer(sec_stat);›Zer(blank);›phree=PrintFreeList()›phree=(phree/128)*128›t_buff=Alloc(phree)›n_sec = phree/128;number of sec inbuf›Print("Buffer size =:")›PrintC(n_sec)›PrintE(" sectors");›size = 128›DO ›insec = 1;initial sector›outsec = 1›pass = 0›IF src_drv <> des_drv THEN› insert_disk(2,src_drv,des_drv)›FI›DO› IF src_drv = des_drv THEN› insert_disk(0,src_drv,des_drv)› FI› Put($7D)› bfr = t_buff; start of buffer› count = 0; keep trac of sec read› DO› Print("SEC :")› PrintC(insec)› res = sio('1,src_drv,'R,bfr,size,insec)› IF (res = 144) THEN› tmp = 4;› sio('1,src_drv,'S,stat,tmp,dum)› a = stat(1)› a = a & 38› IF a THEN› bitmap(insec,sec_stat)› PrintE("Âáä");› FI› FI› a = clear(bfr,size)› IF a THEN› bitmap(insec,blank)› PrintE("âìáîë");› ELSE› PutE() Put($1C)› bfr = bfr + size;› count ==+1› FI› insec ==+1› IF insec > 1040 THEN EXIT FI› UNTIL count = n_sec; memory filled› OD› Put($7D)› PrintE("Writing sectors to disk")› IF des_drv = src_drv THEN› insert_disk(1,des_drv,src_drv)› FI› IF pass = 0 THEN› res=yesno("Æïòíáô Äåóôéîáôéïî Äéóë¿")› IF res THEN› sio('1,des_drv,'",buff,size,dum)› FI› pass = 1› FI› Put($7D)› bfr = t_buff› cnt = 0;› DO› Put($9C);› Print("SEC :");› PrintC(outsec);› a = check(outsec,blank)› b = check(outsec,sec_stat)› IF a > 0 AND b > 0 THEN› Print(" Âáä");› Zero(buff)› sio('1,des_drv,'w,buff,size,outsec)› outsec ==+1› ELSEIF a> 0 AND b = 0 THEN› Print(" Âìáîë");› Zero(buff)› sio('1,des_drv,'P,buff,size,outsec)› outsec ==+1› ELSEIF a = 0 AND b > 0 THEN› Print(" Âáä");› sio('1,des_drv,'w,bfr,size,outsec)› bfr ==+ size;› cnt ==+1› outsec ==+1› ELSEIF a = 0 AND b = 0 THEN› sio('1,des_drv,'P,bfr,size,outsec)› bfr ==+ size› outsec ==+1› cnt ==+1› FI› IF outsec > 1040 THEN done = 1 EXIT FI› UNTIL count = cnt› OD› UNTIL done›OD›PrintE("ÃÏÐÙ ÉÓ ÄÏÎÅ ÒÅÍÏÖÅ ÄÉÓ˨ө");›PutE()›PutE()›wait()›OD›RETURN›MODULE›SET EndProg=*›SET Start=main› ››